﻿@{
    ViewBag.Title = "库统计报表";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}

<script>
    var moduleId = $.request("moduleId");
    $(function () {
        initControl();
        gridList();
        })
        function initControl() {
            $('select').bindSelect();
            $("#ZSJ_B1_GH_SI").bindSelect({
                url: "/BaseData/ZSJ_B1_GH_SI/GetGridJson",
                id: "UnitID",
                text: "UnitNOShortName"
            });
        }
    function gridList() {
        var $gridList = $("#gridList");
        $("#gridList").dataGrid({
            url: "/VBaseData/V_CPK_11_DJ_StoRegister/GetGridJson?moduleId=" + moduleId,
            height: $(window).height() - 120,
            colModel: [
            { label: "单据编号", name: "FCurDate", width: 160, align: 'left' },
            { label: "发生单位", name: "FHappenCompanyName", width: 120, align: 'left' },
            { label: '发生单位编号', name: 'FHappenCompanyNO', width: 160, align: 'left' },
            { label: '零件编号', name: 'FBatchNo', width: 100, align: 'left' },
            { label: '零件名称', name: 'FQuantity_KP', width: 160, align: 'left' },
            { label: '入库数量', name: 'FQuantity', width: 60, align: 'left' },
            { label: '出库数量', name: 'FContainerNO', width: 60, align: 'left' },
            { label: '当前库存', name: 'FContainerName', width: 60, align: 'left' },


            { label: '库存编号', name: 'FContainerQuantity', width: 80, align: 'left' },
            { label: '供货单位', name: 'FFactContent', width: 100, align: 'left' },
            { label: '供货单位名称', name: 'FContent', width: 100, align: 'left' },
            { label: '零件分类', name: 'FPalletNO', width: 60, align: 'left' },

            { label: '输入日期', name: 'FPalletQuantity', width: 80, align: 'left' },
            { label: '输出时间', name: 'FContainerNO', width: 80, align: 'left' },
            ],
            pager: "#gridPager",
            sortname: 'F_DepartmentId asc,F_CreatorTime desc',
            viewrecords: true,
            multiselect: true,
            onSelectRow: function (rowId) {
                rowData = $gridList.jqGrid('getRowData', rowId);
                index = rowId;
                $.each(rowData, function (key, value) {
                    $("#txt" + key).val(value);
                });
            }
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { keyword: $("#txt_FDocuTypeNO").val() },
            }).trigger('reloadGrid');
        }); 
    }
    function btn_Excel() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/WareHouse/Export/WareHouseNoticeExcel"
        });
    }
    function btn_Print() {
        $.detailOpen({
            id: "Detail",
            title: "",
            url: "/WareHouse/Print/WareHouseNoticePrint"
        });
    }
</script>
<body>
    <div id="layout" style="height: 80%; width: 100%;">
        <form id="form1">
            <div style="padding: 12px 0 5px 0; padding-left:15px; border-bottom:1px solid #ccc;" class="line-table input-width-140">
                <div class="btn-group" style="margin-top:-9px;margin-left:50px;">
                    来料单位<br />
                    <select id="ZSJ_B1_GH_SI" name="F_DutyId" class="form-control">
                        <option value="">==请选择==</option>
                    </select>
                    &nbsp;
                </div>
                <div class="btn-group" style="margin-top:-9px;">
                    零部件号<br />
                    <input id="txt_FDocuTypeNO" name="" placeholder="" type="text" class="form-control required" />
                    &nbsp;
                </div>
                <div class="btn-group" style="margin-top:-9px;">
                    来料日期<br />
                    <input id="" name="" placeholder="" type="text" class="form-control required" onfocus="WdatePicker({ dateFmt: 'yyyy-MM', isShowToday: false, isShowClear: false });" />
                     &nbsp;
                </div>
                <div class="btn-group">
                    <a id="btn_search" class="btn btn-primary center-block" onclick=""><span class="glyphicon glyphicon-search"></span> 查询</a>
                </div>
                <div class="btn-group" style="float:right;">
                    <a class="btn btn-primary center-block" onclick="$.reload()">  <span class="glyphicon glyphicon-refresh"> </span>&nbsp刷新</a>
                    <a class="btn btn-primary center-block" onclick="btn_Excel()"> <span class="glyphicon glyphicon-download"></span>&nbsp导出</a>
                    <a class="btn btn-primary center-block" onclick="btn_Print()"> <span class="glyphicon glyphicon-print">   </span>&nbsp打印</a>
                </div>
            </div>
            <div class="gridPanel">
                <table id="gridList"></table>
                <div id="gridPager"></div>
            </div>
        </form>
    </div>
</body>

 